//
//  GTRecommendViewController.m
//  iOSApp01
//
//  Created by yxh on 2020/4/27.
//  Copyright © 2020 yxh. All rights reserved.
//

#import "GTRecommendViewController.h"

@interface GTRecommendViewController ()

@end

@implementation GTRecommendViewController

- (instancetype) init{
    self = [super init];
    if(self){
        self.view.backgroundColor = [UIColor redColor];
        self.tabBarItem.title =@"推荐";
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    UIScrollView *scrollV = [[UIScrollView alloc] initWithFrame:self.view.bounds];
    scrollV.backgroundColor = [UIColor lightGrayColor];
    scrollV.contentSize = CGSizeMake(self.view.bounds.size.width *5, self.view.bounds.size.height);
    
    NSArray *colorArray = @[[UIColor lightGrayColor],[UIColor redColor],[UIColor yellowColor],[UIColor grayColor],[UIColor blueColor]];
    
    for (int i = 0; i < 5; i ++) {
        [ scrollV addSubview:({
            UIView *v = [[UIView alloc] initWithFrame:CGRectMake(scrollV.bounds.size.width * i, 0, scrollV.bounds.size.width, scrollV.bounds.size.height)];
            v.backgroundColor =  [colorArray objectAtIndex:i];
            v;
        }) ];
    }
    
    scrollV.pagingEnabled =YES;
    [self.view addSubview:scrollV];
    
}


@end
